class PrintChar{
  constructor(char,num){
    this.char = char;
    this.num = num;
  }

  for4(){
    for(let i = 1; i<=this.num; i++){
      let result = "";
      for(let j = 1; j<=this.num -i;j++){
        result += " ";
      }
      for(let k = 1; k<=2*i-1;k++){
        if (i == this.num){
          result += this.char;
        }else if ((k==1 || k==2*i-1) && i!=this.num) {
          result +=this.char;
        }else {
          result +=" ";
        }
      }
      console.log(result);
    }
  }
}

var print = new PrintChar("A",11);

print.for4();
